<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8" />
    <title></title>
    <link href="../../assets/lib/layui/css/layui.css" rel="stylesheet" />
    <link href="../../assets/lib/winui/css/winui.css" rel="stylesheet" />
</head>
<div style="padding: 20px; margin: 0 auto;">
    <form class="layui-form" action="" id="showForm">

    </form>
</div>

<script type="text/x-handlebars-template" id="formTemplate">
    <div class="layui-form-item layui-col-xs12">
            <span class="hr-title">基本信息</span><hr>
    </div>
        <div class="layui-form-item layui-col-xs6">
            <label class="layui-form-label">优惠券模版<i class="red">*</i></label>
            <div class="layui-input-block">
                <select id="templateId" name="templateId" win-verify="required" lay-filter="templateId">
                </select>
            </div>
        </div>
        <div class="layui-form-item layui-col-xs6">
            <label class="layui-form-label">门店</label>
            <div class="layui-input-block" id="storeIdList">

            </div>
        </div>
        <div class="layui-form-item layui-col-xs6">
            <label class="layui-form-label">名称<i class="red">*</i></label>
            <div class="layui-input-block">
                <input type="text" id="name" name="name" win-verify="required" placeholder="请输入名称" class="layui-input"/>
            </div>
        </div>
        <div class="layui-form-item layui-col-xs6">
            <label class="layui-form-label">状态<i class="red">*</i></label>
            <div class="layui-input-block winui-radio" id="enabled">
            </div>
        </div>

        <div class="layui-form-item layui-col-xs12">
            <span class="hr-title">发放信息</span><hr>
        </div>
        <div class="layui-form-item layui-col-xs6">
            <label class="layui-form-label">发放数量<i class="red">*</i></label>
            <div class="layui-input-block">
                <input type="text" id="totalCount" name="totalCount" lay-verify="number" autocomplete="off" placeholder="请输入发放数量" class="layui-input"/>
                <div class="layui-form-mid layui-word-aux">发放数量为-1时，表示不限制发放数量</div>
            </div>
        </div>
        <div class="layui-form-item layui-col-xs6">
            <label class="layui-form-label">每人限领数量<i class="red">*</i></label>
            <div class="layui-input-block">
                <input type="text" id="takeLimitCount" name="takeLimitCount" win-verify="required|number" placeholder="请输入每人限领数量" class="layui-input" value="1"/>
            </div>
        </div>
        <div class="layui-form-item layui-col-xs6">
            <label class="layui-form-label">使用优惠券的次数<i class="red">*</i></label>
            <div class="layui-input-block">
                <input type="text" id="useCount" name="useCount" win-verify="required|number" placeholder="请输入使用优惠券的次数" class="layui-input" value="1"/>
            </div>
        </div>
        <div class="layui-form-item layui-col-xs6">
            <label class="layui-form-label">领取方式<i class="red">*</i></label>
            <div class="layui-input-block winui-radio" id="takeType">
            </div>
        </div>

        <div class="layui-form-item layui-col-xs12">
            <span class="hr-title">适用商品</span><hr>
        </div>
        <div class="layui-form-item layui-col-xs6">
            <label class="layui-form-label">商品范围<i class="red">*</i></label>
            <div class="layui-input-block winui-radio" id="productScope">
            </div>
        </div>
        <div id="couponMaterialListBox" style="display: none;">
            <div class="layui-form-item layui-col-xs6">
                <label class="layui-form-label">适用商品<i class="red">*</i></label>
                <div class="layui-input-block" id="couponMaterialList">

                </div>
            </div>
        </div>

        <div class="layui-form-item layui-col-xs12">
            <span class="hr-title">有效期</span><hr>
        </div>
        <div class="layui-form-item layui-col-xs8">
            <label class="layui-form-label">类型<i class="red">*</i></label>
            <div class="layui-input-block winui-radio" id="validityType">
            </div>
        </div>
        <div id="fixedTime">
            <div class="layui-form-item layui-col-xs6">
                <label class="layui-form-label">开始时间<i class="red">*</i></label>
                <div class="layui-input-block">
                    <input type="text" id="validStartTime" name="validStartTime" placeholder="请选择开始时间" class="layui-input"/>
                </div>
            </div>
            <div class="layui-form-item layui-col-xs6">
                <label class="layui-form-label">结束时间<i class="red">*</i></label>
                <div class="layui-input-block">
                    <input type="text" id="validEndTime" name="validEndTime" placeholder="请选择结束时间" class="layui-input"/>
                </div>
            </div>
        </div>
        <div id="receiveTime" style="display: none;">
            <div class="layui-form-item layui-col-xs6">
                <label class="layui-form-label">领取延时时间<i class="red">*</i></label>
                <div class="layui-input-block">
                    <input type="text" id="fixedStartTime" name="fixedStartTime" placeholder="请输入领取延时时间" class="layui-input"/>
                    <div class="layui-form-mid layui-word-aux">领取几天后可以开始使用，单位：天</div>
                </div>
            </div>
            <div class="layui-form-item layui-col-xs6">
                <label class="layui-form-label">有效期<i class="red">*</i></label>
                <div class="layui-input-block">
                    <input type="text" id="fixedEndTime" name="fixedEndTime" placeholder="请输入有效期" class="layui-input"/>
                    <div class="layui-form-mid layui-word-aux">领取开始使用时几天后结束，单位：天</div>
                </div>
            </div>
        </div>

        <div class="layui-form-item layui-col-xs12">
            <span class="hr-title">折扣信息</span><hr>
        </div>
        <div class="layui-form-item layui-col-xs8">
            <label class="layui-form-label">折扣类型<i class="red">*</i></label>
            <div class="layui-input-block winui-radio" id="discountType">
            </div>
        </div>
    <div class="layui-form-item layui-col-xs6">
        <label class="layui-form-label">满减金额<i class="red">*</i></label>
        <div class="layui-input-block">
            <input type="text" id="usePrice" name="usePrice" win-verify="money" placeholder="请输入满减金额" class="layui-input"/>
            <div class="layui-form-mid layui-word-aux">单位：分。0 - 不限制，大于 0 - 多少金额可用</div>
        </div>
    </div>
        <div id="percentBox" style="display: none;">
            <div class="layui-form-item layui-col-xs6">
                <label class="layui-form-label">折扣百分比<i class="red">*</i></label>
                <div class="layui-input-block">
                    <input type="text" id="discountPercent" name="discountPercent" placeholder="请输入折扣百分比" class="layui-input"/>
                    <div class="layui-form-mid layui-word-aux">折扣百分比，例如，80% 为 80</div>
                </div>
            </div>
        </div>
        <div id="priceBox">

            <div class="layui-form-item layui-col-xs6">
                <label class="layui-form-label">优惠金额<i class="red">*</i></label>
                <div class="layui-input-block">
                    <input type="text" id="discountPrice" name="discountPrice" placeholder="请输入优惠金额" class="layui-input"/>
                    <div class="layui-form-mid layui-word-aux">优惠金额，单位：分</div>
                </div>
            </div>
        </div>

        <div class="layui-form-item layui-col-xs6">
            <label class="layui-form-label">折扣上限<i class="red">*</i></label>
            <div class="layui-input-block">
                <input type="text" id="discountLimitPrice" name="discountLimitPrice" placeholder="请输入折扣上限" class="layui-input"/>
                <div class="layui-form-mid layui-word-aux">折扣上限，百分比折扣也受其约束</div>
            </div>
        </div>

        <div class="layui-form-item layui-col-xs12">
            <label class="layui-form-label">相关描述</label>
            <div class="layui-input-block">
                <textarea id="remark" name="remark" placeholder="请输入相关描述" class="layui-textarea" style="height: 100px;" maxlength="200"></textarea>
            </div>
        </div>
        <div class="layui-form-item layui-col-xs6">
            <div class="layui-input-block">
                <button class="winui-btn" id="cancle"><language showName="com.skyeye.cancel"></language></button>
                <button class="winui-btn" lay-submit lay-filter="formWriteBean"><language showName="com.skyeye.save"></language></button>
            </div>
        </div>
</script>

<script src="../../assets/lib/layui/layui.js"></script>
<script src="../../assets/lib/layui/custom.js"></script>
<script type="text/javascript">
    layui.config({ base: '../../js/coupon/' }).use('write');
</script>
</body>

</html>